home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Plus
/
Graphics Plus.iso
/
general
/
raytrace
/
rayshade
/
graphtal.lzh
/
Graphtal.Amiga
/
ExampleDevice.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-17
|
2KB
|
69 lines
/*
* ExampleDevice.C - example device driver.
*
* Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
* University of Berne, Switzerland
* All rights reserved.
*
* This software may be freely copied, modified, and redistributed
* provided that this copyright notice is preserved on all copies.
*
* You may not distribute this software, in whole or in part, as part of
* any commercial product without the express consent of the authors.
*
* There is no warranty or other guarantee of fitness of this software
* for any purpose. It is provided solely "as is".
*
*/
#include <iostream.h>
#include "ExampleDevice.h"
#include "Polygon.h"
//___________________________________________________________ ExampleDevice
ExampleDevice::ExampleDevice()
{}
void ExampleDevice::begin()
{
cout << "Begin graphics\n";
}
void ExampleDevice::end(const BoundingBox&)
{
cout << "End graphics\n";
cout.flush();
}
void ExampleDevice::cylinder(const Vector& p1, const Vector& p2, real r)
{
if (definingMacro)
return;
cout << "Cylinder " << p1 << p2 << ' ' << r << '\n';
}
void ExampleDevice::cone(const Vector& p1, real r1, const Vector& p2, real r2)
{
if (definingMacro)
return;
cout << "Cone " << p1 << ' ' << r1 << ' ' << p2 << " " << r2 << '\n';
}
void ExampleDevice::sphere(const Vector& p, real r)
{
if (definingMacro)
return;
cout << "Sphere " << r << ' ' << p << "\n";
}
void ExampleDevice::polygon(Polygon* p)
{
if (definingMacro)
return;
cout << "Poly\n";
for (register long i=0; i<p->numVertices(); i++)
cout << p->vertex(i) << '\n';
}